from flask import Flask


app = Flask(__name__)


@app.before_first_request
def before_first_request():
	print('服务器第一次接收请求的时候执行')


@app.before_request
def before_request():
	print('每次请求之前都会执行')


@app.after_request
def after_request(response):
	print('每次请求之后都会执行')
	return response


@app.teardown_request
def teardown_request(response):
	print('请求结束的时候执行')


@app.route('/get')
def hello_world():  # put application's code here
	return '请求钩子结束'


if __name__ == '__main__':
	app.run()
